package com.aaa.controller;

import com.aaa.entity.PmsProduct;
import com.aaa.entity.PmsProductCategory;
import com.aaa.entity.SmsHomeAdvertise;
import com.aaa.service.ProTypeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("proType")
public class ProTypeController {

    @Resource
    ProTypeService proTypeService;

//    首页商品分类查询
    @RequestMapping("typeList")
    @ResponseBody
    public List<Map<String,Object>> typeList(){
        System.out.println(proTypeService.typeList());
        return proTypeService.typeList();
    }
//    按类型查询所有
    @RequestMapping("selectProId")
    @ResponseBody
    public List<PmsProduct> selectProId(Integer productCategoryId){
        return proTypeService.selectProId(productCategoryId);
    }
//    首页轮播图
    @RequestMapping("selectAdverty")
    @ResponseBody
    public List<Map<String,Object>> selectAdverty(){
        return proTypeService.selectAdverty();
    }

//    全部商品查询
    @RequestMapping("projectList")
    @ResponseBody
    public List<Map<String,Object>> projectList(){
        System.out.println(proTypeService.projectList());
        return proTypeService.projectList();
    }

    @RequestMapping("proList")
    @ResponseBody
    public List<Map<String,Object>> proList(Integer id){
        return proTypeService.proList(id);
    }
}
